<!DOCTYPE html>
<html lang="zh">

<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://cdn.staticfile.net/vue/2.7.8/vue.js"></script>
    <link href="../css/style.css" rel="stylesheet">
</head>

<body>
<div id="app">
    <div v-if="result == 0">成绩没有公布</div>
    <div v-else-if="result < 60">{{result}}分-考试不及格</div>
    <div v-else-if="result < 80">{{result}}分- 还需努力</div>
    <div v-else>{{result}}分- 不错</div>
    <button type="button" @click="btnClick">点击</button>
</div>
<script>
    const vm = new Vue({
        el: '#app',
        data: {
            result: 0
        },
        methods: {
            btnClick: function () {
                this.result = Math.round(Math.random() * 100)
            }
        }
    });
</script>
</body>
</html>